<?php

/**
 * ChangePasswordForm class.
 * RegisterForm is the data structure for keeping
 * user change password form data. It is used by the 'register' action of 'user/profile/changePassword'
 */
class ChangePasswordForm extends CFormModel
{
	public $old_password;
	public $password;
	public $password_repeat;


	public function rules()
	{
		return array(
			array('old_password, password, password_repeat', 'required'),
			array('password','length','min'=>5,'max'=>15),
			// password must match password_repeat
			array('password_repeat', 'compare', 'compareAttribute'=>'password'),
		);
	}

	/**
	 * Declares attribute labels.
	 */
	public function attributeLabels()
	{
		return array(
			'old_password'=>'Mật khẩu cũ',
			'password'=>'Mật khẩu mới',
			'password_repeat'=>'Xác nhận lại'
		);
	}

}
